﻿using System;

using KingsSharp.Core.Data.Entity;
using CRM.Admin.Contracts.Model.Sys;

namespace CRM.Admin.Services.EntityConfigurations.Sys
{
    public class UserRoleConfiguration : EntityConfigurationBase<UserRole, Guid>
    {
        public UserRoleConfiguration()
        {
            this.HasRequired(a => a.User).WithMany(b => b.UserRoles).HasForeignKey(c => c.UserId);
            this.HasRequired(a => a.Role).WithMany().HasForeignKey(c => c.RoleId);
        }
    }
}
